package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Credit;
import cn.wolfcode.trip.base.mapper.CreditMapper;
import cn.wolfcode.trip.base.service.ICreditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CreditServiceimpl implements ICreditService{
    @Autowired
    private CreditMapper creditMapper;

    @Override
    public void update(Long userId, int totalCredits) {
        creditMapper.update(userId,totalCredits);
    }

    @Override
    public Credit getCredits(Long userId) {
        return creditMapper.selectByUserId(userId);
    }
}
